<configuration>
    <property>
       <name>dfs.nameservices</name>
       <value>{{ hdfs_cluster_name }}</value>
    </property>
    <property>
       <name>dfs.ha.namenodes.{{ hdfs_cluster_name }}</name>
       <value>nna,nns</value>
    </property>
   
    <property>
       <name>dfs.namenode.rpc-address.{{ hdfs_cluster_name }}.nna</name>
       <value>{{ nna_host }}:8020</value>
    </property>
    <property>
       <name>dfs.namenode.rpc-address.{{ hdfs_cluster_name }}.nns</name>
       <value>{{ nns_host }}:8020</value>
    </property>
    
    <property>
       <name>dfs.namenode.http-address.{{ hdfs_cluster_name }}.nna</name>
       <value>{{ nna_host }}:50070</value>
    </property>
    <property>
       <name>dfs.namenode.http-address.{{ hdfs_cluster_name }}.nns</name>
       <value>{{ nns_host }}:50070</value>
    </property>
    
    <property>
       <name>dfs.namenode.servicerpc-address.{{ hdfs_cluster_name }}.nna</name>
       <value>{{ nna_host }}:8021</value>
    </property>
    <property>
       <name>dfs.namenode.servicerpc-address.{{ hdfs_cluster_name }}.nns</name>
       <value>{{ nns_host }}:8021</value>
    </property>
    
    <property>
       <name>dfs.namenode.shared.edits.dir</name>
       <value>qjournal://{{ journalnode_hosts }}/{{ hdfs_cluster_name }}</value>
    </property>
    <property>
       <name>dfs.journalnode.edits.dir</name>
       <value>{{ journalnode_edit_dir }}</value>
    </property>
    <property>
       <name>dfs.client.failover.proxy.provider.{{ hdfs_cluster_name }}</name>
       <value>org.apache.hadoop.hdfs.server.namenode.ha.ConfiguredFailoverProxyProvider</value>
    </property>
    <property>
       <name>dfs.ha.fencing.methods</name>
       <value>
          sshfence
          shell(/bin/true)
       </value>
    </property>
    <property>
       <name>dfs.ha.fencing.ssh.private-key-files</name>
       <value>/home/{{ owner }}/.ssh/id_rsa</value>
    </property>
    <property>
       <name>dfs.ha.automatic-failover.enabled</name>
       <value>true</value>
    </property>
    <property>
       <name>dfs.namenode.name.dir</name>
       <value>{{ namenode_dir }}</value>
    </property>
    <property>
       <name>dfs.datanode.data.dir</name>
       <value>{{ datanode_dir }}</value>
    </property>
    <property>
       <name>dfs.webhdfs.enabled</name>
       <value>true</value>
    </property>
    <property>
       <name>dfs.journalnode.http-address</name>
       <value>0.0.0.0:8480</value>
    </property>
    <property>
       <name>dfs.journalnode.rpc-address</name>
       <value>0.0.0.0:8485</value>
    </property>
    <property>
       <name>ha.zookeeper.quorum</name>
       <value>{{ zookeeper_quorum }}</value>
    </property>
    
    <property>  
       <name>dfs.permissions.enabled</name>  
       <value>true</value>  
    </property>  
    <property>
        <name>dfs.permissions.ContentSummary.subAccess</name>
        <value>true</value>
    </property>
    <property>
       <name>dfs.namenode.acls.enabled</name>  
       <value>true</value>  
    </property>
    <property>
       <name>dfs.datanode.du.reserved</name>
       <value>107374182400</value>
    </property>
    <property>
       <name>dfs.namenode.audit.log.async</name>
       <value>true</value>
    </property>
    <property>
       <name>dfs.namenode.balancer.request.standby</name>
       <value>true</value>
    </property>

<!-- start Kerberos -->
    <property>
       <name>dfs.block.access.token.enable</name>
       <value>true</value>
    </property>
    <property>
       <name>dfs.datanode.data.dir.perm</name>
       <value>700</value>
    </property>
    <property>
       <name>dfs.namenode.keytab.file</name>
       <value>{{ keytabs_path }}/{{ namenode_keytab_name }}</value>
    </property>
    <property>
       <name>dfs.namenode.kerberos.principal</name>
       <value>{{ namenode_princname }}/_HOST@{{ kdc_domain }}</value>
    </property>
    <property>
       <name>dfs.namenode.kerberos.https.principal</name>
       <value>HTTP/_HOST@{{ kdc_domain }}</value>
    </property>
    <property>
       <name>dfs.datanode.address</name>
       <value>0.0.0.0:1004</value>
    </property>
    <property>
       <name>dfs.datanode.http.address</name>
       <value>0.0.0.0:1006</value>
    </property>
    <property>
       <name>dfs.datanode.keytab.file</name>
       <value>{{ keytabs_path }}/{{ datanode_keytab_name }}</value>
    </property>
    <property>
       <name>dfs.datanode.kerberos.principal</name>
       <value>{{ datanode_princname }}/_HOST@{{ kdc_domain }}</value>
    </property>
    <property>
       <name>dfs.datanode.kerberos.https.principal</name>
       <value>HTTP/_HOST@{{ kdc_domain }}</value>
    </property>
    <property>
       <name>dfs.data.transfer.protection</name>
       <value>authentication</value>
    </property>

<!-- HA-->
    <property>
       <name>dfs.journalnode.keytab.file</name>
       <value>{{ keytabs_path }}/{{ journalnode_keytab_name }}</value>
    </property>
    <property>
       <name>dfs.journalnode.kerberos.principal</name>
       <value>{{ journalnode_princname }}/_HOST@{{ kdc_domain }}</value>
    </property>
    <property>
       <name>dfs.journalnode.kerberos.internal.spnego.principal</name>
       <value>HTTP/_HOST@{{ kdc_domain }}</value>
    </property>
   
<!-- webHDFS -->
    <property>
       <name>dfs.webhdfs.enabled</name>
       <value>false</value>
    </property>
    <property>
       <name>dfs.web.authentication.kerberos.principal</name>
       <value>HTTP/_HOST@{{ kdc_domain }}</value>
    </property>
    <property>
       <name>dfs.web.authentication.kerberos.keytab</name>
       <value>{{ keytabs_path }}/{{ namenode_keytab_name }}</value>
    </property>

<!-- balancer -->
    <property>
       <name>dfs.balancer.kerberos.principal</name>
       <value>{{ namenode_princname }}/_HOST@{{ kdc_domain }}</value>
    </property>    
    <property>
       <name>dfs.balancer.keytab.file</name>
       <value>{{ keytabs_path }}/{{ namenode_keytab_name }}</value>
    </property>
    <property>
       <name>dfs.balancer.keytab.enabled</name>
       <value>true</value>
    </property>    
    <property>
       <name>dfs.balancer.address</name>
       <value>0.0.0.0:0</value>
    </property>
<!-- end kerberos -->

<!-- 调优 start -->
    <property>
       <name>dfs.datanode.max.transfer.threads</name>
       <value>10240</value>
    </property>
    <property>
       <name>dfs.client.socket-timeout</name>
       <value>1800000</value>
    </property>
    <property>
       <name>dfs.datanode.handler.count</name>
       <value>150</value>
    </property>
    <property>
       <name>dfs.datanode.balance.bandwidthPerSec</name>
       <value>1024m</value>
    </property>
    <property>
       <name>dfs.qjournal.write-txns.timeout.ms</name>
       <value>600000</value>
    </property>
    <property>
       <name>dfs.namenode.handler.count</name>
       <value>80</value>
    </property>
    <property>
       <name>dfs.namenode.service.handler.count</name>
       <value>40</value>
    </property>
    <property>
       <name>dfs.datanode.balance.max.concurrent.moves</name>
       <value>20</value>
    </property>
    <property>
       <name>dfs.namenode.delegation.key.update-interval</name>
       <value>86400000</value>
    </property>
    <property>
       <name>dfs.namenode.delegation.token.max-lifetime</name>
       <value>604800000</value>
    </property>     
    <property>
       <name>dfs.namenode.delegation.token.renew-interval</name>
       <value>86400000</value>
    </property>     
<!--
    <property>
        <name>dfs.datanode.failed.volumes.tolerated</name>
        <value>3</value>
        <description>允许最大坏盘数</description>
    </property>
-->
<!-- 调优 end -->

</configuration>
